<template>
    <el-form-item v-if="curComponent.component=='Picture'" >
        <el-input  v-model="imgValue" type="text" />
        <Upload :type="'primary'" @confrim="(e)=>{confrimImg(e, curComponent)}" :text="'上传图片'"></Upload>
    </el-form-item>
</template>

<script>
import  Upload  from '../Upload/index.vue'
export default {
  props:['curComponent'],
  components:{Upload},
  data() {
    return {
        imgValue:this.curComponent.propValue.value?this.curComponent.propValue.value:this.curComponent.propValue
    }
  },
  methods: {
       confrimImg(e,data){
         if(typeof data.propValue=='object'){
             data.propValue.value=e
         }else{
             data.propValue=e
         }
        },
  },
}
</script>

<style>

</style>